﻿CREATE TABLE [dbo].[Order_Item] (
    [Id]              INT              IDENTITY (1, 1) NOT FOR REPLICATION NOT NULL,
    [OId]             UNIQUEIDENTIFIER CONSTRAINT [DF_Order_Item_OId] DEFAULT (newid()) ROWGUIDCOL NULL,
    [ProductId]       INT              NULL,
    [ProductName]     NVARCHAR (50)    NULL,
    [ProductCateId]   INT              NULL,
    [ProductCateName] NVARCHAR (50)    NULL,
    [UnitPrice]       DECIMAL (18, 2)  NULL,
    [Quantity]        INT              NULL,
    [Salesman]        NVARCHAR (50)    NULL,
    [SalesmanAccount] NVARCHAR (50)    NULL,
    [DepId]           INT              NULL,
    [CompanyId]       INT              NULL,
    [CreateDate]      DATETIME         NULL,
    [Occupancy]       NVARCHAR (50)    NULL,
    [IsValid]         BIT              NULL,
    [Description]     NVARCHAR (200)   NULL,
    [TradeDate]       DATETIME         NULL,
    CONSTRAINT [PK_Order_Item] PRIMARY KEY CLUSTERED ([Id] ASC)
);


GO
CREATE NONCLUSTERED INDEX [IX_Order_Item_OId]
    ON [dbo].[Order_Item]([OId] ASC);


GO
CREATE NONCLUSTERED INDEX [IX_Order_Item_SalesmanAccount]
    ON [dbo].[Order_Item]([SalesmanAccount] ASC);


GO
CREATE NONCLUSTERED INDEX [IX_Order_Item_TradeDate]
    ON [dbo].[Order_Item]([TradeDate] ASC);


GO
CREATE NONCLUSTERED INDEX [EFS_IX_Order_Item_d4b9c85fc10545859de7823d2aaa8a44]
    ON [dbo].[Order_Item]([Occupancy] ASC)
    INCLUDE([UnitPrice], [Quantity]);

